Repository navigation
Conversation
pkriko
marked this pull request as ready for review
November 26, 2026 14:04
pkriko
force-pushed
the
signed-crate-redirects
branch
from
November 26, 2026 14:07
df5c8a8 to
7bb329e
Compare
The download endpoint checks the credential, including the distributions and actions a Cargo token is scoped to, then redirects to the content app. The content app does not know Cargo tokens, so a content guard that checks the user (an RBAC content guard) sees a Cargo token request as anonymous and refuses it, and cargo_auth_required alone leaves the crate files readable by anyone who knows their path. When cargo_auth_required is set and the distribution has a content guard that can preauthenticate a URL, the content redirect guard, the redirect now points to a signed URL that expires after an hour, so the content app relies on the check the download endpoint already made. Without cargo_auth_required the endpoint checks nothing, so the redirect stays unsigned and the guard still applies. Assisted By: Claude Opus 5.5
pkriko
force-pushed
the
signed-crate-redirects
branch
from
November 26, 2026 14:38
516a43b to
ec10d2f
Compare
Contributor
Author
|
Closed by mistake. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Checklist
Follow-up of #71, which left the
.cratefiles out: the download endpoint redirects to the content app, and the content app does not know Cargo tokens.403("Authentication credentials were not provided."), even for a user with the viewer role. AddingCargoTokenAuthenticationto the instance-wide authentication classes would fix the download, but would make a Cargo token valid on every API endpoint, outside its distribution and action scopes.core.content_redirect), the download endpoint now redirects to a URL signed withpreauthenticate_url(), aspulp_ansibleandpulp_containerdo. The content app then relies on the check the download endpoint already made, token scopes included. The signature expires after an hour.cargo_auth_requiredis set, i.e. when the download endpoint actually checked the credential; otherwise the redirect stays unsigned and the guard still applies.See: Pull Request Walkthrough